package com.example.administrator.uiautomator.pages;

import android.provider.Contacts;
import android.support.test.uiautomator.UiObject2;

import com.example.administrator.uiautomator.utils.Finder;

/**
 * Created by Administrator on 2017/7/5.
 */

public class PageCommon {

    private Finder finder;

    public PageCommon(Finder finder){
        this.finder = finder;
    }

    public UiObject2 getHomeTab(){
        return finder.findById("com.netease.newsreader.activity:id/a04",0);
    }

    public UiObject2 getMyTab(){
        return finder.findById("com.netease.newsreader.activity:id/a04",4);
    }

    public void clickHomeTab(){
        getHomeTab().click();
    }

    public void clickMyTab(){
        getMyTab().click();
    }

    public void goBack(){
        finder.goBack();
    }
}
